<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" template="/template/template.xhtml"
	xmlns:s="http://sduept.security.el/func">
	<ui:define name="head">
		<link rel="stylesheet"
			href="/resources/plugins/datatables/dataTables.bootstrap.css" />
		<style>
.ui-tabs .ui-tabs-panel {
	border-width: 0;
	padding: 0.4em 0.4em;
	background: 0;
}
</style>
	</ui:define>
	<ui:define name="content">
		<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
			<p:commandButton value="是" type="button"
				styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
			<p:commandButton value="否" type="button"
				styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
		</p:confirmDialog>
		<div class='full-center-content-scroll-noheader'>
			<div class="col-sm-12 col-lg-12">
				<h:form id="headForm">
					<p:growl id="msgs" showDetail="true" />
					<div class="box box-solid with-border">
						<div class="box-header">
							<!-- <p:outputLabel value="设备状态：" style="margin-right:5px" />
							<h:selectOneMenu id="status" value="#{equipmentLedgerController.status}" style="width:100px;height:30px;margin-right:10px">
								<f:selectItem itemLabel="全部" itemValue="" />
								<f:selectItem itemLabel="可用" itemValue="0" />
								<f:selectItem itemLabel="不可用" itemValue="1" />
							</h:selectOneMenu> -->
							<p:outputLabel value="所属变电站： " />
							<p:autoComplete id="startionSearch" dropdown="true"
								placeholder="变电站首字母查询" scrollHeight="400"
								value="#{equipmentLedgerController.subStation}"
								style="margin-right:10px"
								completeMethod="#{equipmentLedgerController.complateStation}">
							</p:autoComplete>
							<p:commandButton icon="ui-icon-search" value="查询"
								update="headForm:startionSearch tabv:busbarForm tabv:transForm tabv:breakerForm tabv:compensatorForm"
								actionListener="#{equipmentLedgerController.query}" style="margin-left:5px;" />
							<p:commandButton icon="ui-icon-refresh" value="重置" update="headForm:startionSearch tabv:busbarForm tabv:transForm tabv:breakerForm tabv:compensatorForm"
								actionListener="#{equipmentLedgerController.resetQueryStation}" style="margin-left:5px;" />
						</div>
					</div>
				</h:form>
				<p:tabView id="tabv" cache="false" dynamic="true" >
					<p:tab title="母线">
						<h:form id="busbarForm">
							<p:dataTable id="table" var="item"
								value="#{equipmentLedgerController.busbarModel}" rowIndexVar="ite"
								lazy="true" rowKey="#{item.id}"
								style="margin-bottom:0;text-align:center" emptyMessage="无记录"
								rows="20" paginator="true"
								paginatorTemplate="{Customization} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
								rowsPerPageTemplate="20,50,100" paginatorPosition="bottom">
								<f:facet name="{Customization}">
									<p:outputLabel
										value="总计：#{equipmentLedgerController.rowCount} 条记录"
										style="margin-right:20px;" />
								</f:facet>
								<p:column headerText="序号" width="4%">
									<h:outputText value="#{ite+1}" />
								</p:column>
								<p:column headerText="设备名称" width="9%">
									<h:outputText value="#{item.name}" />
								</p:column>
								<p:column headerText="所属变电站" width="9%">
									<h:outputText value="#{item.subName}" />
								</p:column>
								<p:column headerText="调管单位" width="9%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).dispatchUnit}" />
								</p:column>
								<p:column headerText="运维单位" width="9%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).maintenanceUnit}" />
								</p:column>
								<p:column headerText="单位类型" width="9%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).unitType}" />
								</p:column>
								<p:column headerText="资产归属" width="9%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).assetOwner}" />
								</p:column>
								<p:column headerText="一次设备检修范围" width="9%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).primaryEquipmentScope}" />
								</p:column>
								<p:column headerText="一次设备检修范围备注" width="10%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).primaryEquipmentScopeRemark}" />
								</p:column>
								<p:column headerText="二次设备检修范围" width="9%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).secondaryEquipmentScope}" />
								</p:column>
								<p:column headerText="二次设备检修范围备注" width="10%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).secondaryEquipmentScopeRemark}" />
								</p:column>
							</p:dataTable>
						</h:form>
					</p:tab>
					<p:tab title="变压器">
						<h:form id="transForm">
							<p:dataTable id="table2" var="item"
								value="#{equipmentLedgerController.transModel}" rowIndexVar="ite"
								lazy="true" rowKey="#{item.id}"
								style="margin-bottom:0;text-align:center" emptyMessage="无记录"
								rows="20" paginator="true"
								paginatorTemplate="{Customization} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
								rowsPerPageTemplate="20,50,100" paginatorPosition="bottom">
								<f:facet name="{Customization}">
									<p:outputLabel
										value="总计：#{equipmentLedgerController.rowCount2} 条记录"
										style="margin-right:20px;" />
								</f:facet>
								<p:column headerText="序号" width="4%">
									<h:outputText value="#{ite+1}" />
								</p:column>
								<p:column headerText="设备名称" width="9%">
									<h:outputText value="#{item.name}" />
								</p:column>
								<p:column headerText="所属变电站" width="9%">
									<h:outputText value="#{item.subName}" />
								</p:column>
								<p:column headerText="调管单位" width="9%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).dispatchUnit}" />
								</p:column>
								<p:column headerText="运维单位" width="9%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).maintenanceUnit}" />
								</p:column>
								<p:column headerText="单位类型" width="9%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).unitType}" />
								</p:column>
								<p:column headerText="资产归属" width="9%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).assetOwner}" />
								</p:column>
								<p:column headerText="一次设备检修范围" width="9%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).primaryEquipmentScope}" />
								</p:column>
								<p:column headerText="一次设备检修范围备注" width="10%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).primaryEquipmentScopeRemark}" />
								</p:column>
								<p:column headerText="二次设备检修范围" width="9%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).secondaryEquipmentScope}" />
								</p:column>
								<p:column headerText="二次设备检修范围备注" width="10%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).secondaryEquipmentScopeRemark}" />
								</p:column>
							</p:dataTable>
						</h:form>
					</p:tab>
					<p:tab title="断路器">
						<h:form id="breakerForm">
							<p:dataTable id="table3" var="item"
								value="#{equipmentLedgerController.breakerModel}" rowIndexVar="ite"
								lazy="true" rowKey="#{item.id}"
								style="margin-bottom:0;text-align:center" emptyMessage="无记录"
								rows="20" paginator="true"
								paginatorTemplate="{Customization} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
								rowsPerPageTemplate="20,50,100" paginatorPosition="bottom">
								<f:facet name="{Customization}">
									<p:outputLabel
										value="总计：#{equipmentLedgerController.rowCount3} 条记录"
										style="margin-right:20px;" />
								</f:facet>
								<p:column headerText="序号" width="4%">
									<h:outputText value="#{ite+1}" />
								</p:column>
								<p:column headerText="设备名称" width="9%">
									<h:outputText value="#{item.name}" />
								</p:column>
								<p:column headerText="所属变电站" width="9%">
									<h:outputText value="#{item.subName}" />
								</p:column>
								<p:column headerText="调管单位" width="9%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).dispatchUnit}" />
								</p:column>
								<p:column headerText="运维单位" width="9%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).maintenanceUnit}" />
								</p:column>
								<p:column headerText="单位类型" width="9%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).unitType}" />
								</p:column>
								<p:column headerText="资产归属" width="9%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).assetOwner}" />
								</p:column>
								<p:column headerText="一次设备检修范围" width="9%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).primaryEquipmentScope}" />
								</p:column>
								<p:column headerText="一次设备检修范围备注" width="10%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).primaryEquipmentScopeRemark}" />
								</p:column>
								<p:column headerText="二次设备检修范围" width="9%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).secondaryEquipmentScope}" />
								</p:column>
								<p:column headerText="二次设备检修范围备注" width="10%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).secondaryEquipmentScopeRemark}" />
								</p:column>
							</p:dataTable>
						</h:form>
					</p:tab>
					<p:tab title="电抗器">
						<h:form id="compensatorForm">
							<p:dataTable id="table4" var="item"
								value="#{equipmentLedgerController.compensatorModel}" rowIndexVar="ite"
								lazy="true" rowKey="#{item.id}"
								style="margin-bottom:0;text-align:center" emptyMessage="无记录"
								rows="20" paginator="true"
								paginatorTemplate="{Customization} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
								rowsPerPageTemplate="20,50,100" paginatorPosition="bottom">
								<f:facet name="{Customization}">
									<p:outputLabel
										value="总计：#{equipmentLedgerController.rowCount4} 条记录"
										style="margin-right:20px;" />
								</f:facet>
								<p:column headerText="序号" width="4%">
									<h:outputText value="#{ite+1}" />
								</p:column>
								<p:column headerText="设备名称" width="9%">
									<h:outputText value="#{item.name}" />
								</p:column>
								<p:column headerText="所属变电站" width="9%">
									<h:outputText value="#{item.subName}" />
								</p:column>
								<p:column headerText="调管单位" width="9%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).dispatchUnit}" />
								</p:column>
								<p:column headerText="运维单位" width="9%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).maintenanceUnit}" />
								</p:column>
								<p:column headerText="单位类型" width="9%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).unitType}" />
								</p:column>
								<p:column headerText="资产归属" width="9%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).assetOwner}" />
								</p:column>
								<p:column headerText="一次设备检修范围" width="9%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).primaryEquipmentScope}" />
								</p:column>
								<p:column headerText="一次设备检修范围备注" width="10%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).primaryEquipmentScopeRemark}" />
								</p:column>
								<p:column headerText="二次设备检修范围" width="9%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).secondaryEquipmentScope}" />
								</p:column>
								<p:column headerText="二次设备检修范围备注" width="10%">
									<h:outputText value="#{equipmentLedgerController.getSubstationLedger(item.subId).secondaryEquipmentScopeRemark}" />
								</p:column>
							</p:dataTable>
						</h:form>
					</p:tab>
				</p:tabView>
			</div>
		</div>
	</ui:define>
	<ui:define name="contentend">
		<script>
			function onSelectDivClick() {
				var div = $('#selectDiv');
				if (div.hasClass('in')) {
					div.collapse('hide');
					$('#selectButtonIcon').removeClass("fa fa-caret-up");
					$('#selectButtonIcon').addClass("fa fa-caret-down");
				} else {
					div.collapse('show');
					$('#selectButtonIcon').removeClass("fa fa-caret-down");
					$('#selectButtonIcon').addClass("fa fa-caret-up");
				}
			}
		</script>
	</ui:define>
</ui:composition>
